package com.fsx.provider.controller;

import com.fsx.provider.entity.Goods;
import com.fsx.provider.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * goods 服务的提供方
 */
@RestController
@RequestMapping("/goods")
public class GoodsController {

    @Autowired
    private GoodsService goodsService;

    @GetMapping("/findOneById/{id}")
    public Goods finOneById(@PathVariable int id) {
        Goods goods = goodsService.finOneById(id);
        return goods;
    }
}
